/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * frmDetails.java
 *
 * Created on May 22, 2011, 7:48:27 AM
 */

package Ordermanagement;

import Account.SizeMonition;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Vector;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author BachDEV
 */
public class frmDetails extends javax.swing.JFrame {

    public JTable tbOrderDetails;
    public JTable tblPaymentDetails;
    frmOrder order;
    double totalValueOfOrder = 0;
    double totalPayment = 0;
    double amountUnpaid = 0;
    public int ordid = 0;
    public boolean paystatus = true;
    public static int x;
    public static int y;

    /** Creates new form frmDetails */
    public frmDetails(frmOrder order) {
        try{
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        }catch(InstantiationException ex){
            ex.printStackTrace();
        }catch(UnsupportedLookAndFeelException ex){
            ex.printStackTrace();
        }catch(ClassNotFoundException ex){
            ex.printStackTrace();
        }catch(IllegalAccessException ex){
            ex.printStackTrace();
        }
        initComponents();
        Dimension ds = Toolkit.getDefaultToolkit().getScreenSize();
            x = this.getWidth();
            y = this.getHeight();
            this.setLocation((ds.width - this.getWidth()) / 2, (ds.height - this.getHeight()) / 2);
        this.order = order;
        try {
            tbOrderDetails = buildTableOrderDetails();
            scrOrderDetails.setViewportView(tbOrderDetails);
            tblPaymentDetails = buildTablePaymentDetails();
            scrPaymentDetails.setViewportView(tblPaymentDetails);
            setField();
        } catch (Exception ex) {
            ex.printStackTrace();
            JOptionPane.showMessageDialog(this, ex.getMessage());
        }

    }

    public void motion() {
        this.setSize(0, 0);
        new Thread(new SizeMonition(this, x, y)).start();
    }
    /////////////////////////////////////////////////////////////////////////
     public void setField() throws Exception {
        Connection connect = null;
        PreparedStatement stmt = null;
        ResultSet rs = null;
        String sql = "Select cusName,cusAddress,cusPhone,cusEmail,ordName,ordAddress,ordPhone,ordID,ordDate,payStatus from Orders join Customer on Orders.cusID=Customer.cusID where ordID=?";
        try {
            connect = Connections.DBConnection.getConnection("eProject", "sa", "123");
            stmt = connect.prepareStatement(sql);
            stmt.setString(1, order.tbOrder.getValueAt(order.tbOrder.getSelectedRow(), 0).toString().trim());
            rs = stmt.executeQuery();
            if (rs.next()) {
                lbCustomerName.setText(rs.getString(1) + "");
                lbCustomerAddress.setText(rs.getString(2) + "");
                lbCustomerPhone.setText(rs.getString(3) + "");
                lbCustomerEmail.setText(rs.getString(4) + "");
                lbRecipientName.setText(rs.getString(5) + "");
                lbRecipientAddress.setText(rs.getString(6) + "");
                lbRecipientPhone.setText(rs.getString(7) + "");
                ordid = rs.getInt(8);
                lbOrderID.setText(ordid + "");
                lbOrderDate.setText(rs.getDate(9) + "");
                paystatus = rs.getBoolean(10);

            }
        } catch (Exception ex) {
            throw ex;
        } finally {
            try {
                Connections.DBConnection.closeConnection(connect, stmt, rs);
            } catch (Exception ex) {
                throw ex;
            }
        }
    }

    public JTable buildTableOrderDetails() throws Exception {
        JTable table = null;
        Vector column = new Vector();
        column.add("Product Name");
        column.add("Quantity");
        column.add("Price");
        column.add("Amount");
        Vector data = new Vector();
        Vector row;
        Connection connect = null;
        Connection connectTotal = null;
        PreparedStatement stmt = null;
        PreparedStatement stmtTotal = null;
        ResultSet rs = null;
        ResultSet rsTotal = null;
        String sql = "select proName,Quantity,Price,Quantity*Price as Amount from OrderDetails join Product on OrderDetails.proID = Product.proID where ordID = ?";
        String sqlTotal = "select sum(Quantity*Price) as Total from OrderDetails where ordID = ?";
        try {
            connect = Connections.DBConnection.getConnection("eProject", "sa", "123");
            stmt = connect.prepareStatement(sql);
            stmt.setString(1, order.tbOrder.getValueAt(order.tbOrder.getSelectedRow(), 0).toString().trim());
            rs = stmt.executeQuery();
            while (rs.next()) {
                row = new Vector();
                row.add(rs.getString(1));
                row.add(rs.getInt(2));
                row.add(rs.getDouble(3) + "$");
                row.add(rs.getDouble(4) + "$");
                data.add(row);
            }
            connectTotal = Connections.DBConnection.getConnection("eProject", "sa", "123");
            stmtTotal = connectTotal.prepareStatement(sqlTotal);
            stmtTotal.setString(1, order.tbOrder.getValueAt(order.tbOrder.getSelectedRow(), 0).toString().trim());
            rsTotal = stmtTotal.executeQuery();
            if (rsTotal.next()) {
                row = new Vector();
                row.add("Total value of orders");
                row.add("");
                row.add("");
                totalValueOfOrder = rsTotal.getDouble(1);
                row.add(totalValueOfOrder + "$");
                data.add(row);
            }
            table = new JTable(data, column);
        } catch (Exception ex) {
            throw ex;
        } finally {
            try {
                Connections.DBConnection.closeConnection(connect, stmt, rs);
                Connections.DBConnection.closeConnection(connectTotal, stmtTotal, rsTotal);
            } catch (Exception ex) {
                throw ex;
            }
        }
        return table;

    }
////////////////////////////////////////////////////////////////////////////
     public JTable buildTablePaymentDetails() throws Exception {
        JTable table = null;
        Vector column = new Vector();
        column.add("PayID");
        column.add("No.");
        column.add("Date");
        column.add("Collector");
        column.add("Amount");
        Vector data = new Vector();
        Vector row;
        Connection connect = null;
        Connection connectTotal = null;
        PreparedStatement stmt = null;
        PreparedStatement stmtTotal = null;
        ResultSet rs = null;
        ResultSet rsTotal = null;
        String sql = "select payID,Date,Users.FullName as [FullName],Amount from Payment join Users on Payment.userName=Users.userName where ordID = ?";
        String sqlTotal = "select sum(Amount) as Total from Payment where ordID = ?";
        try {
            connect = Connections.DBConnection.getConnection("eProject", "sa", "123");
            stmt = connect.prepareStatement(sql);
            stmt.setString(1, order.tbOrder.getValueAt(order.tbOrder.getSelectedRow(), 0).toString().trim());
            rs = stmt.executeQuery();
            int i = 1;
            while (rs.next()) {
                row = new Vector();
                row.add(rs.getInt("payID"));
                row.add(i);
                row.add(rs.getDate("Date"));
                row.add(rs.getString("FullName"));
                row.add(rs.getDouble("Amount"));
                data.add(row);
                i++;
            }
            connectTotal = Connections.DBConnection.getConnection("eProject", "sa", "123");
            stmtTotal = connectTotal.prepareStatement(sqlTotal);
            stmtTotal.setString(1, order.tbOrder.getValueAt(order.tbOrder.getSelectedRow(), 0).toString().trim());
            rsTotal = stmtTotal.executeQuery();
            if (rsTotal.next()) {
                row = new Vector();
                row.add("");
                row.add("Total payment");
                row.add("");
                row.add("");
                totalPayment = rsTotal.getDouble(1);
                row.add(totalPayment + "$");
                //data.add(rsTotal.getDouble("Total"));
                data.add(row);

            }
            amountUnpaid = totalValueOfOrder - totalPayment;
            row = new Vector();
            row.add("");
            row.add("Amount unpaid");
            row.add("");
            row.add("");
            row.add(amountUnpaid + "$");
            data.add(row);
            table = new JTable(data, column);
            table.getColumnModel().getColumn(0).setMinWidth(0);
            table.getColumnModel().getColumn(0).setWidth(0);
            table.getColumnModel().getColumn(0).setMaxWidth(0);

        } catch (Exception ex) {
            throw ex;
        } finally {
            try {
                Connections.DBConnection.closeConnection(connect, stmt, rs);
            } catch (Exception ex) {
                throw ex;
            }
        }
        return table;
    }
/////////////////////////////////////////////////////////////////////////////
     public void updatePaymentStatus() throws Exception {
        Connection connect = null;
        PreparedStatement stmt = null;
        String sql = "Update Orders set payStatus=? where ordID=?";
        try {
            connect = Connections.DBConnection.getConnection("eProject", "sa", "123");
            stmt = connect.prepareStatement(sql);
            if (paystatus) {
                stmt.setBoolean(1, false);
            } else {
                stmt.setBoolean(1, true);
            }
            stmt.setInt(2, ordid);
            stmt.executeUpdate();
            JOptionPane.showMessageDialog(this, "Update succedfully!");
        } catch (Exception ex) {
            throw ex;
        } finally {
            try {
                Connections.DBConnection.closeConnection(connect, stmt, null);
            } catch (Exception ex) {
                throw ex;
            }
        }
    }

    public void deleteDatabase() throws Exception {
        Connection connect = null;
        PreparedStatement stmt = null;
        String sql = "Delete Payment where payID=?";
        try {
            connect = Connections.DBConnection.getConnection("eProject", "sa", "123");
            stmt = connect.prepareStatement(sql);
            int payid = Integer.parseInt(tblPaymentDetails.getValueAt(tblPaymentDetails.getSelectedRow(), 0).toString());
            stmt.setInt(1, payid);
            stmt.executeUpdate();
            tblPaymentDetails = buildTablePaymentDetails();
            JOptionPane.showMessageDialog(this, "Delete successfull!");
            scrPaymentDetails.setViewportView(tblPaymentDetails);

        } catch (Exception ex) {
            throw ex;
        } finally {
            try {
                Connections.DBConnection.closeConnection(connect, stmt, null);
            } catch (Exception ex) {
                throw ex;
            }
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel4 = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jLabel14 = new javax.swing.JLabel();
        lbCustomerPhone = new javax.swing.JLabel();
        lbCustomerName = new javax.swing.JLabel();
        lbCustomerAddress = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        lbCustomerEmail = new javax.swing.JLabel();
        scrOrderDetails = new javax.swing.JScrollPane();
        jLabel2 = new javax.swing.JLabel();
        lbOrderDate = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel17 = new javax.swing.JLabel();
        lbRecipientPhone = new javax.swing.JLabel();
        lbRecipientName = new javax.swing.JLabel();
        lbRecipientAddress = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        lbOrderID = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        btnExit = new javax.swing.JButton();
        scrPaymentDetails = new javax.swing.JScrollPane();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Order Details"));
        jPanel4.setPreferredSize(new java.awt.Dimension(700, 406));

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Customer information"));
        jPanel1.setPreferredSize(new java.awt.Dimension(300, 140));

        jLabel14.setText("Phone");

        lbCustomerPhone.setForeground(new java.awt.Color(0, 0, 153));
        lbCustomerPhone.setText("Customer  Phone");

        lbCustomerName.setForeground(new java.awt.Color(0, 0, 153));
        lbCustomerName.setText("Customer name");

        lbCustomerAddress.setForeground(new java.awt.Color(0, 0, 153));
        lbCustomerAddress.setText("Customer  Address");

        jLabel16.setText("Email");

        jLabel12.setText("Address");

        jLabel15.setText("Name");

        lbCustomerEmail.setForeground(new java.awt.Color(0, 0, 153));
        lbCustomerEmail.setText("Customer  Email");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel14)
                    .addComponent(jLabel16)
                    .addComponent(jLabel12)
                    .addComponent(jLabel15))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lbCustomerName)
                    .addComponent(lbCustomerAddress)
                    .addComponent(lbCustomerEmail)
                    .addComponent(lbCustomerPhone))
                .addContainerGap(147, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(lbCustomerName)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(lbCustomerAddress)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(lbCustomerPhone)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(lbCustomerEmail))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel15)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel12)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel16)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabel2.setText("Order ID: ");

        lbOrderDate.setFont(new java.awt.Font("Tahoma", 1, 11));
        lbOrderDate.setText("Order Date: ");

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Recipient information"));
        jPanel2.setPreferredSize(new java.awt.Dimension(300, 140));

        jLabel17.setText("Phone");

        lbRecipientPhone.setForeground(new java.awt.Color(0, 0, 153));
        lbRecipientPhone.setText("Recipient  Phone");

        lbRecipientName.setForeground(new java.awt.Color(0, 0, 153));
        lbRecipientName.setText("Recipient name");

        lbRecipientAddress.setForeground(new java.awt.Color(0, 0, 153));
        lbRecipientAddress.setText("Recipient  Address");

        jLabel19.setText("Address");

        jLabel20.setText("Name");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel17)
                    .addComponent(jLabel19)
                    .addComponent(jLabel20))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lbRecipientName)
                    .addComponent(lbRecipientAddress)
                    .addComponent(lbRecipientPhone))
                .addContainerGap(163, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel20)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel19)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel17))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(lbRecipientName)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(lbRecipientAddress)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(lbRecipientPhone)))
                .addContainerGap(38, Short.MAX_VALUE))
        );

        jLabel3.setText("Order Date: ");

        lbOrderID.setFont(new java.awt.Font("Tahoma", 1, 11));
        lbOrderID.setText("Order ID: ");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(scrOrderDetails, javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addComponent(jLabel2)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(lbOrderID))
                            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 321, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(30, 30, 30)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addComponent(jLabel3)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(lbOrderDate))
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 335, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addGap(127, 127, 127))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(35, 35, 35)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(lbOrderID)
                    .addComponent(jLabel3)
                    .addComponent(lbOrderDate))
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(9, 9, 9)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 143, Short.MAX_VALUE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(scrOrderDetails, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Payment details"));
        jPanel3.setPreferredSize(new java.awt.Dimension(700, 246));

        btnExit.setText("Exit");
        btnExit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnExitActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(scrPaymentDetails, javax.swing.GroupLayout.DEFAULT_SIZE, 687, Short.MAX_VALUE)
                    .addComponent(btnExit, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(scrPaymentDetails, javax.swing.GroupLayout.DEFAULT_SIZE, 153, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(btnExit)
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 743, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.LEADING, 0, 723, Short.MAX_VALUE)
                    .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 723, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 685, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExitActionPerformed
        dispose();
        order.setEnabled(true);
        order.setAlwaysOnTop(true);
}//GEN-LAST:event_btnExitActionPerformed

    /**
    * @param args the command line arguments
    */
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnExit;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JLabel lbCustomerAddress;
    private javax.swing.JLabel lbCustomerEmail;
    private javax.swing.JLabel lbCustomerName;
    private javax.swing.JLabel lbCustomerPhone;
    private javax.swing.JLabel lbOrderDate;
    public javax.swing.JLabel lbOrderID;
    private javax.swing.JLabel lbRecipientAddress;
    private javax.swing.JLabel lbRecipientName;
    private javax.swing.JLabel lbRecipientPhone;
    private javax.swing.JScrollPane scrOrderDetails;
    public javax.swing.JScrollPane scrPaymentDetails;
    // End of variables declaration//GEN-END:variables

}
